package com.techsoul.module.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.common.core.pojo.vo.UserVo;
import com.techsoul.module.basic.pojo.vo.CustomerVo;
import com.techsoul.module.goods.pojo.entity.Spu;
import com.techsoul.module.order.pojo.entity.SalesOrderHis;
import com.techsoul.module.order.pojo.entity.SalesOrderItemHis;
import com.techsoul.module.order.pojo.param.SalesOrderItemHisSaveParam;
import com.techsoul.module.order.pojo.param.SalesOrderItemHisSearchParam;
import com.techsoul.module.order.pojo.vo.SalesOrderItemHisVo;
import com.techsoul.module.order.pojo.vo.SalesOrderItemVo;
import com.techsoul.module.goods.pojo.entity.Sku;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 销售订单明细 Service接口
 * 
 * @author liuen
 * @date 2021-07-31
 */
public interface ISalesOrderItemHisService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(SalesOrderItemHisSaveParam params);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(SalesOrderItemHisSaveParam params);

    /**
     * 修改
     * @param id
     * @param params
     * @return
     */
    Integer update(String id, SalesOrderItemHisSaveParam params);
    /**
     * 详情
     * @param id
     * @return
     */
    SalesOrderItemHisVo findById(String id);

    /**
     * 列表
     * @param params
     * @return
     */
    List<SalesOrderItemHisVo> findAll(SalesOrderItemHisSearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<SalesOrderItemHisVo> findAll(SalesOrderItemHisSearchParam params, Integer current, Integer pageSize);
    /**
     * 历史数据导入
     * @param file
     * @return
     */
    String dataMigration(String customerNo, MultipartFile file);
    SalesOrderItemVo removeSpecialChar(SalesOrderItemVo input);
    Sku generateNewSku(SalesOrderItemVo materialBuyPriceVo, Spu spu);
    Spu generateNewSpu(SalesOrderItemVo materialBuyPriceVo);
    SalesOrderItemHis addMigrationItem(SalesOrderHis newSalesOrder, SalesOrderItemVo data, UserVo user, int itemNo, int line);
    SalesOrderHis addMigrationSalesOrder(SalesOrderItemVo salesOrderItemVo, UserVo user, CustomerVo customerVo, int line);
    void genOperationLog(SalesOrderItemHis data,UserVo user );
}
